package com.example.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.commons.entity.Users;
import com.example.user.entity.po.UserDo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<UserDo> {

    @Select("select * from users where username = #{username} and status = 1")
    Users selectUserByUserName(String username);

    @Insert("insert into users(id,username,password,create_time) values(#{id},#{username},#{password},#{create_time})")
    int register(@Param("id") String id, @Param("username") String username, @Param("password") String password,
                 @Param("create_time") String createTime);
}
